<?
    class SearchController extends Principio_Library_ControllerAction
    {
        public function init()
        {
            parent::init();
        }

        public function indexAction()
        {
            $this->view->title = "Search results";
            if ($this->is_post)
            {
                if ($this->checkPostItemString("search_text", "Search string"))
                {
                    $search_result = Principio_Model_SearchMapper::search($this->post_data["search_text"], $this->post_data["search_table"]);
                    if (empty($search_result))
                        Principio_Library_Common::$msg = "No results";
                    else
                        $this->view->search_result = $search_result;
                }

            }
        }
    }
?>